Sep 18, 2019

## Warning: package 'plotly' was built under R version 3.5.3

Summary

In this excersize, we do a quick data summary of the ToothGrowth data and look at the differences in the amount of Tooth Growth in 60 Guinea Pigs via two different delivery methods of Vitamin C (Orange Juice (OJ) or Ascorbic Acid (VC)) and differences in the dosage of the delivery method (0.5, 1, 2mg/day).

For the purposes of this assigment, I've used a previous analysis to create a plotly plot and presenting in slide form.

Setup

First, we load the ToothGrowth dataset from R and store it into a variable.

library(datasets)
library(ggplot2)
TG<-ToothGrowth

Basic Summary

To do a quick data summary we'll look at the Mean and Standard Deviation of tooth length for each trial

##   supp dose len.mn  len.std
## 1   OJ  0.5  13.23 4.459709
## 2   VC  0.5   7.98 2.746634
## 3   OJ  1.0  22.70 3.910953
## 4   VC  1.0  16.77 2.515309
## 5   OJ  2.0  26.06 2.655058
## 6   VC  2.0  26.14 4.797731

Next, we'll plot the data in Boxplots to get an idea of what all that means.

p<-plot_ly(TG, y=~len, color = ~supp, type="box")

Plotly Toothlength Plot

Comparing Tests

Because there are a lot of combinations we could test, we'll slim this down to testing between delivery method then by dosage. We'll do a basic two-sided T-test to see if the differences are great enough to call effective (p<.05).

-In this first test, we're comparing the delivery methods (Orange Juice vs Ascorbic Acid), with the p-value being:

## [1] 0.06063451

Comparing Tests Continued

Now, combining the delivery methods to see the effects of the difference dosages. -First, comparing 0.5mg/day to 1mg/day, we get a p-value of:

## [1] 1.268301e-07

-Second, comparing 0.5mg/day to 2mg/day, we get a p-value of:

## [1] 4.397525e-14

-Lastly, comparing 1mg/day to 2mg/day, we get a p-value of:

## [1] 1.90643e-05

Conclusions

After viewing this data, we can see that while it appears the delivery method matters, the p-value of delivery method is close to but still >0.05, meaning the method of delivery probably has no relation to tooth growth. Using the assumption that delivery method doesn't matter, we combined the delivery methods to compare the effect of dosage. After performing T-tests against the various dosages we can see that increasing the dosages is highly correlated to increased tooth growth with the very low p-values (p<<0.05).